// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';

class MianListVC extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('主页'),
        ),
        body: ListView(
          children: [
            MainListItem('点赞页面', '', 'zan'),
            MainListItem('基础布局', '', 'base'),
            MainListItem('登录注册', '', 'form'),
            MainListItem('高级布局', '', 'zan'),
            MainListItem('仿豆瓣页面', '', 'zan'),
          ],
        ));
  }
}

class MainListItem extends StatelessWidget {
  final String title;
  final String message;
  final String routeName;
  MainListItem(this.title, this.message, this.routeName);
  @override
  Widget build(BuildContext context) {
    return InkWell(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            title,
            style: const TextStyle(fontSize: 24),
          ),
          Text(message),
          Divider(
            height: 1.0,
            indent: 1.0,
            color: Colors.red,
          ),
        ],
      ),
      onTap: () {
        Navigator.pushNamed(context, routeName);
      },
    );
  }
}
